package org.lanqiao.tjut.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.lanqiao.tjut.bean.TBStudentBean;
import org.lanqiao.tjut.model.ModelFactory;
import org.lanqiao.tjut.myUtils.MyUtils;

/**
 * 学生信息查询 StudentInfoQueryServlet
 */
@WebServlet("/StudentInfoQueryServlet")
public class StudentInfoQueryServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// 获取查询表单的实体类参数
		TBStudentBean stuB=MyUtils.convertRequest2Bean(request, TBStudentBean.class, null, null);
		//调用model层进行数据查询
		List<TBStudentBean> lstStus=ModelFactory.getStudentInfoModelInstance().queryStudentInfoByParas(stuB);
		//将查询结果集缓存到session对象中
		request.getSession().setAttribute("lstStus", lstStus);
		//跳转到查询结果显示页面
		request.getRequestDispatcher("WEB-INF/logined/studentInfoManager/studentInfoQuery.jsp").forward(request, response);;
	}

}
